<div class="main-container-inner" ng-app="MyApp" ng-controller="TaskListController" id="TaskListController" style="">
    #parse("deployList/sidebar.htm")
    <div class="main-content">
        #parse("deployList/breadcrumb.htm")
        <div class="page-content">
            <div class="page-header">
                <a class="btn btn-sm btn-pink" href="javascript:;" style="visibility: hidden;"
                   title="预览当前生成的 nginx config 文件">
                    <i class="icon-eye-open bigger-110"></i><span class="bigger-110 no-text-shadow">用来占行</span>
                </a> <a ng-show="creating" ng-click="creating=false" style="float: right; margin-left: 20px;"
                        class="btn">取消</a>
                <button ng-show="creating" ng-click="addTask()" style="float: right;" class="btn btn-primary">
                    <i class="icon-ok bigger-110"></i>确定
                </button>
                <a class="btn btn-primary" ng-hide="creating" ng-click="creating=true" href="javascript:;"
                   style="float: right; margin-right: 20px; margin-top: 0px" class=""> <i class="icon-edit"></i>&nbsp;创建任务
                </a>
            </div>
            <div class="row" ng-hide="creating">
                <div id="alertMessageDiv" style="text-align: center;"></div>
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover" id="taskListTable">
                        <thead>
                        <tr>
                            <th>操作</th>
                            <th>任务名</th>
                            <th>状态</th>
                            <th><i class="icon-time bigger-110 hidden-480"></i> 创建时间</th>
                        </tr>
                        </thead>
                        <tbody id="adList">
                        #foreach($task in $list)
                        <tr>
                            <td style="width: 200px"><a href="${contextPath}/console/deploy/task/$task.id"><span
                                    class="label label-info">&nbsp; 查看任务 </span></a> &nbsp;<a href="javascript:;"
                                                                                              ng-click="openRemoveTaskModal($task.id)"><span
                                    class="label label-danger">&nbsp; 删除 </span></a></td>
                            <td><b>$task.name</b></td>
                            <td class="#if($task.status=='SUCCESS')td-success #elseif($task.status=='FAILED')td-failed#end">
                                $task.status.desc
                            </td>
                            <td style="width: 200px">$dateFormatUtils.format($task.creationDate,'yyyy年MM月dd日 HH时mm分')
                            </td>
                        </tr>
                        #end
                        </tbody>
                    </table>
                </div>
                #parse("deployList/paginator.htm")
            </div>
            <!-- 创建任务 -->
            <div class="row" ng-show="creating">
                <div id="addTaskAlertDiv"></div>
                <form class="form-horizontal ng-pristine ng-valid" style="margin-top: 0px;">
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="">任务名</label>

                        <div class="col-sm-7">
                            <input id="addTaskModalInput" ng-trim="true" type="text" value="任务"
                                   ng-model="newTask.taskName"
                                   placeholder="输入任务名" class="input-xxlarge">
                        </div>
                    </div>
                </form>
                <div class="tabbable" ng-init="selectedIndex=0">
                    <ul class="nav nav-tabs padding-12 tab-color-blue background-blue">
                        <li ng-class="{active: $index==0}" ng-repeat="(groupName, group) in groups"><a data-toggle="tab"
                                                                                                       href="#tab_{{$index}}">{{group.name}}</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab_{{$index}}" class="tab-pane" ng-class="{active: $index==0}"
                             ng-repeat="(groupName, group) in groups">
                            <form class="form-horizontal">
                                <table style="" class="table table-striped table-bordered table-hover"
                                       id="groupTable_{{groupName}}">
                                    <thead>
                                    <tr>
                                        <th>
                                            <button class="btn btn-xs btn-primary" ng-show="!group.checkAll"
                                                    ng-click="checkAll(group)">全选
                                            </button>
                                            <button class="btn btn-xs btn-danger" ng-show="group.checkAll"
                                                    ng-click="uncheckAll(group)">清空
                                            </button>
                                        </th>
                                        <th>站点名</th>
                                        <th style="">发布版本</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="vs in group.vsList">
                                        <td width="120px"><label><input class="ace" ng-click="check(vs)" type="checkbox"
                                                                        ng-model="vs.selected"> <span
                                                class="lbl"></span>
                                        </label></td>
                                        <td ng-click="check(vs)"><b>{{vs.name}}</b></td>
                                        <td width="30%"><select ng-model="vs.selectedTag"
                                                                ng-options="tag for tag in vs2Tags[vs.name]">
                                            <option value="">-- 选择发布版本 --</option>
                                        </select></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    #parse("deployList/modals.htm")
</div>